package com.dubbo.provider;

import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

import java.io.IOException;


/**
 * @author lihongfeng
 */
public class ProviderApp {

    /**
     * 启动服务端，并加载ProviderConfiguration配置，在ProviderConfiguration 中加载dubbo-provider.properties 其中配置了zookeep地址和dubbo服务
     * @param args
     * @throws IOException
     */
    public static void main(String[] args) throws IOException {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ProviderConfiguration.class);
        context.start();
        System.in.read();
    }

    @Configuration
    @EnableDubbo(scanBasePackages = {"com.dubbo.provider.service"})
    @PropertySource("classpath:/dubbo-provider.properties")
    static class ProviderConfiguration {
    }
}
